<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('权限列表')" />

    <script>
        $(function () {
            $(".btn-input").click(function () {
                $.get("/permission/reload",function (data) {
                    if (data.success){
                        alert("加载完毕！");
                        window.location.reload();
                    }else {
                        alert(data.msg);
                    }
                })
            })
        })
    </script>
</head>
<body class="hold-transition skin-black sidebar-mini">
<div class="wrapper">
    <th:block th:include="include :: navbar" />
    <th:block th:include="include :: menu('permission')" />
    <div class="content-wrapper">
        <section class="content-header">
            <h1>权限管理</h1>
        </section>
        <section class="content">
            <div class="box">
                <!--高级查询--->
                <form class="form-inline" id="searchForm" action="/permission/list" method="post">
                    <input type="hidden" name="currentPage" id="currentPage" value="1">
                    <a href="#" class="btn btn-success btn-input" style="margin: 10px">
                        <span class="glyphicon glyphicon-plus"></span> 重新加载
                    </a>
                </form>
                <!--编写内容-->
                <div class="box-body table-responsive ">
                    <table class="table table-hover table-bordered table-striped">
                        <thead>
                        <tr>
                            <th>编号</th>
                            <th>权限名称</th>
                            <th>权限表达式</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="item:${pageInfo.list}">
                            <td th:text="${(qo.currentPage-1)*qo.pageSize+(itemStat.index+1)}"></td>
                            <td th:text="${item.name}"></td>
                            <td th:text="${item.expression}"></td>
                            <td>
                                <a class="btn btn-danger btn-xs btn-delete" th:data-url="@{'/permission/delete?id='+${item.id}}">
                                    <span class="glyphicon glyphicon-trash"></span> 删除
                                </a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <!--分页-->
                    <th:block th:include="include :: page" />
                </div>
            </div>
        </section>
    </div>
</div>
<script>
    
</script>
<th:block th:include="include :: footer" />
</body>
</html>











